package com.ww.companyCabinetSystem.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.ww.companyCabinetSystem.dao.IResponsibilityDao;
import com.ww.companyCabinetSystem.model.bo.MResponsibilityBo;
import com.ww.companyCabinetSystem.utils.BeanUtils;
import com.ww.keyIdAutomaticGeneration.factory.KeyIdGenerationFactory;
@Component("responsibility")
public class ResponsibilityDaoImpl extends BaseDaoImpl implements
		IResponsibilityDao {

	@Override
	public boolean insertResponsibility(MResponsibilityBo bo) {
		String keyId=KeyIdGenerationFactory.createKeyId();
		bo.setKeyId(keyId);
		BeanUtils.notNull(bo);
		return this.sqlSession.insert("com.ww.companyCabinetSystem.dao.IResponsibilityDao.insertResponsibility",
				bo)>0;
	}

	@Override
	public boolean updateResponsibility(MResponsibilityBo bo) {
		// TODO Auto-generated method stub
		return this.sqlSession.update("com.ww.companyCabinetSystem.dao.IResponsibilityDao.updateResponsibility",
				bo)>0;
	}

	@Override
	public List<MResponsibilityBo> selectByConfitions(MResponsibilityBo bo) {
		// TODO Auto-generated method stub
		return this.sqlSession.selectList("com.ww.companyCabinetSystem.dao.IResponsibilityDao.selectResponsibility",
				bo);
	}

}
